using System;
using System.Data.Linq;

namespace RomanJendrusz.Amazon.ETL.Domain
{
    public class SellerFeedback
    {
        private EntityRef<Customer> ratedBy;
        private string ratedById;
        private EntityRef<Seller> seller;
        private string sellerId;
        private DateTime updated;

        public SellerFeedback()
        {
            seller = new EntityRef<Seller>();
            ratedBy = new EntityRef<Customer>();
        }

        public Seller Seller
        {
            get { return seller.Entity; }
            set
            {
                if (value == null) throw new ArgumentNullException("value");
                seller.Entity = value;
                sellerId = value.SellerId;
            }
        }

        public int SellerFeedbackId { get; set; }
        public short Rating { get; set; }
        public string Commect { get; set; }
        public DateTime Created { get; set; }
        /// <summary>
        /// Gets or sets the row updated.
        /// </summary>
        /// <value>The row updated.</value>
        public DateTime Updated
        {
            get { return updated; }
        }

        public Customer RatedBy
        {
            get { return ratedBy.Entity; }
            set
            {
                if (value == null) throw new ArgumentNullException("value");
                ratedBy.Entity = value;
                ratedById = value.CustomerId;
            }
        }
    }
}